<?php

/**
 * JmsTbCargo form base class.
 *
 * @method JmsTbCargo getObject() Returns the current form's model object
 *
 * @package    jmscargo
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseJmsTbCargoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                     => new sfWidgetFormInputHidden(),
      'user_id'                => new sfWidgetFormInputText(),
      'receiver_id'            => new sfWidgetFormInputText(),
      'cargo_number'           => new sfWidgetFormInputText(),
      'loaded_container_date'  => new sfWidgetFormDateTime(),
      'container_number'       => new sfWidgetFormInputText(),
      'sender_loadersend_date' => new sfWidgetFormDateTime(),
      'tarant_loadersend_date' => new sfWidgetFormDateTime(),
      'recipient_given_date'   => new sfWidgetFormDateTime(),
      'result'                 => new sfWidgetFormTextarea(),
      'yaponoosgarsan_ognoo'   => new sfWidgetFormDateTime(),
      'ub_ochikhtow_ognoo'     => new sfWidgetFormDateTime(),
      'quantity'               => new sfWidgetFormInputText(),
      'reception_tarant_date'  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'user_id'                => new sfValidatorInteger(),
      'receiver_id'            => new sfValidatorInteger(array('required' => false)),
      'cargo_number'           => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'loaded_container_date'  => new sfValidatorDateTime(array('required' => false)),
      'container_number'       => new sfValidatorInteger(array('required' => false)),
      'sender_loadersend_date' => new sfValidatorDateTime(array('required' => false)),
      'tarant_loadersend_date' => new sfValidatorDateTime(array('required' => false)),
      'recipient_given_date'   => new sfValidatorDateTime(array('required' => false)),
      'result'                 => new sfValidatorString(array('required' => false)),
      'yaponoosgarsan_ognoo'   => new sfValidatorDateTime(array('required' => false)),
      'ub_ochikhtow_ognoo'     => new sfValidatorDateTime(array('required' => false)),
      'quantity'               => new sfValidatorInteger(array('required' => false)),
      'reception_tarant_date'  => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('jms_tb_cargo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'JmsTbCargo';
  }

}
